package cn.chenc.framework.demo.service.impl;


import cn.chenc.framework.demo.entity.Role;
import cn.chenc.framework.demo.mapper.RoleMapper;
import cn.chenc.framework.demo.service.RoleService;
import cn.chenc.framework.dynamic.datasource.annotation.ChangDataSource;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 　@description: TODO
 * 　@author secret
 * 　@date 2020/11/30 10:09
 *
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Override
    @ChangDataSource(name = "slaveDataSource")
    public IPage queryRolePageList(Role role) {
        IPage page=new Page(role.getPageIndex(),role.getPageSize());
        IPage iPage=this.page(page,null);
        return iPage;
    }



}
